home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 February: Technology Seed / Mac Tech Seed Feb '97.toast / OpenDoc 1.2b2c1 / Implementation / Messaging / SemtIntB.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1997-02-13  |  15.0 KB  |  429 lines  |  [TEXT/MPS ]

  1.  
  2. /*
  3.  *  This file was generated by the SOM Compiler.
  4.  *  Generated using:
  5.  *     SOM incremental update: somc/smmain.c
  6.  */
  7.  
  8.  
  9. /*
  10.     File:        SemtIntB.cpp
  11.  
  12.     Contains:    Implementation of platform-independent ODSemanticInterface
  13.                 class.
  14.  
  15.     Owned by:    Nick Pilch
  16.  
  17.     Copyright:    © 1994 - 1996 by Apple Computer, Inc., all rights reserved.
  18.  
  19.     Change History (most recent first):
  20.  
  21.          <3>      12/19/96    JP        1614769: Added comment about kODAppShell ==
  22.                                     kODNULL
  23.          <2>     9/26/96    JP        1323103: Disabled marking
  24.         <21>     10/8/95    TJ        Fixes Recomended by Refball
  25.         <20>     8/23/95    NP        1276287: Move constant kODAppShell.
  26.         <19>     8/16/95    NP        1275241: IDL Review. Remove unnecessary
  27.                                     overrides.
  28.         <18>     8/12/95    TÇ        1276806 Optimization: use kODFalse instead
  29.                                     of kODTrue in comparisons
  30.         <17>      8/7/95    NP        1275105:  Exception safety.
  31.         <16>      8/3/95    RR        #1257260: Collapse B classes. Remove
  32.                                     somInit methods. Don't call IsInitialized
  33.                                     or SubclassResponsibility
  34.         <15>     6/20/95    JP        1251250: Removed ReleaseExtension method
  35.         <14>     6/19/95    eeh        1259707: SIHelper needs to return
  36.                                     errAEEventNotHandled
  37.         <13>     5/21/95    NP        1249232: Gid rid of TokenInquiryProc.
  38.                                     1250474: Change to CallGetMarkTokenProc.
  39.                                     1248779: Change API of GetUserToken.
  40.                                     1250590: Add default behavior to
  41.                                     ODSemanticInterface.
  42.         <12>      5/4/95    eeh        1243497: implement ReleaseExtension
  43.         <11>     4/28/95    eeh        1244258: : override BaseRemoved, IsValid,
  44.                                     and CheckValid
  45.         <10>     1/27/95    NP        1213948: New classes for ODDesc et al.
  46.          <9>     1/25/95    eeh        1214626: API change: remove SetTerminology
  47.                                     and GetTerminology
  48.          <8>      1/9/95    NP        1194880: SemtIntf name changes.
  49.          <7>    10/12/94    RA        #1189812: Prevents incomplete cast #warning
  50.                                     18.
  51.          <6>     9/29/94    RA        1189812: Mods for 68K build.
  52.          <5>      9/9/94    NP        1185851: implement scripting. 1184040: API
  53.                                     changes.
  54.          <4>      9/9/94    jpa        Removed call to parent in Release, at
  55.                                     Nick's suggestion. [1185656]
  56.          <3>     8/13/94    NP        1180819-Added Get/SetTerminology and
  57.                                     ForwardEvent.,
  58.          <2>      7/8/94    NP        Fixed initialization.
  59.          <1>      7/1/94    NP        first checked in
  60.  
  61.     To Do:
  62. */
  63.  
  64. #ifndef SOM_ODMessageInterface_xh
  65. #include "MssgIntf.xh"
  66. #endif
  67.  
  68. #ifndef SOM_ODSession_xh
  69. #include "ODSessn.xh"
  70. #endif
  71.  
  72. #define VARIABLE_MACROS
  73. #define ODSemanticInterface_Class_Source
  74. #include <SemtIntB.xih>
  75.  
  76. #ifndef SOM_ODPart_xh
  77. #include "Part.xh"
  78. #endif
  79.  
  80. #ifndef SOM_ODPart_xh
  81. #include "Part.xh"
  82. #endif
  83.  
  84. #ifndef SOM_Module_OpenDoc_StdDefs_defined
  85. #include <StdDefs.xh>
  86. #endif
  87.  
  88. #ifndef __AEOBJECTS__
  89. #include <AEObjects.h>
  90. #endif
  91.  
  92. #if 0
  93. //------------------------------------------------------------------------------
  94. // ODSemanticInterface::somUninit
  95. //------------------------------------------------------------------------------
  96.  
  97. SOM_Scope void  SOMLINK ODSemanticInterfacesomUninit(ODSemanticInterface *somSelf)
  98. {
  99.     /* ODSemanticInterfaceData *somThis = ODSemanticInterfaceGetData(somSelf); */
  100.     ODSemanticInterfaceMethodDebug("ODSemanticInterface","ODSemanticInterfacesomUninit");
  101.  
  102.     ODSemanticInterface_parents_somUninit(somSelf);
  103. }
  104. #endif /* 0 */
  105.  
  106. //------------------------------------------------------------------------------
  107. // ODSemanticInterface::BaseRemoved
  108. //------------------------------------------------------------------------------
  109.  
  110. SOM_Scope void  SOMLINK ODSemanticInterfaceBaseRemoved(ODSemanticInterface *somSelf, Environment *ev)
  111. {
  112.     ODSemanticInterfaceData *somThis = ODSemanticInterfaceGetData(somSelf);
  113.     ODSemanticInterfaceMethodDebug("ODSemanticInterface","ODSemanticInterfaceBaseRemoved");
  114.  
  115.     SOM_TRY
  116.     
  117.     _fIsValid = kODFalse;
  118.     ODSemanticInterface_parents_BaseRemoved(somSelf, ev);
  119.     
  120.     SOM_CATCH_ALL
  121.     SOM_ENDTRY
  122. }
  123.  
  124. //------------------------------------------------------------------------------
  125. // ODSemanticInterface::IsValid
  126. //------------------------------------------------------------------------------
  127.  
  128. SOM_Scope ODBoolean  SOMLINK ODSemanticInterfaceIsValid(ODSemanticInterface *somSelf, Environment *ev)
  129. {
  130.     ODSemanticInterfaceData *somThis = ODSemanticInterfaceGetData(somSelf);
  131.     ODSemanticInterfaceMethodDebug("ODSemanticInterface","ODSemanticInterfaceIsValid");
  132.  
  133.     return _fIsValid;
  134. }
  135.  
  136. //------------------------------------------------------------------------------
  137. // ODSemanticInterface::CheckValid
  138. //------------------------------------------------------------------------------
  139.  
  140. SOM_Scope void  SOMLINK ODSemanticInterfaceCheckValid(ODSemanticInterface *somSelf, Environment *ev)
  141. {
  142.     ODSemanticInterfaceData *somThis = ODSemanticInterfaceGetData(somSelf);
  143.     ODSemanticInterfaceMethodDebug("ODSemanticInterface","ODSemanticInterfaceCheckValid");
  144.  
  145.     if ( !_fIsValid )
  146.         ODSetSOMException( ev, kODErrInvalidExtension );
  147. }
  148.  
  149. //------------------------------------------------------------------------------
  150. // ODSemanticInterface::Release
  151. //------------------------------------------------------------------------------
  152.  
  153. SOM_Scope void  SOMLINK ODSemanticInterfaceRelease(ODSemanticInterface *somSelf, Environment *ev)
  154. {
  155.     ODSemanticInterfaceData *somThis = ODSemanticInterfaceGetData(somSelf);
  156.     ODSemanticInterfaceMethodDebug("ODSemanticInterface","ODSemanticInterfaceRelease");
  157.     
  158.     SOM_TRY
  159.  
  160.     ODBoolean    shouldDelete = kODFalse;
  161.  
  162.     // NOTE: kODAppShell is defined as kODNULL. This means that we
  163.     // cannot distinguish between a semantic interface whose base
  164.     // was removed and the shell's semantic interface.
  165.  
  166.     if (somSelf->GetRefCount(ev) == 1 && somSelf->GetBase(ev) == kODAppShell)
  167.         shouldDelete = kODTrue;
  168.  
  169.     ODSemanticInterface_parent_ODExtension_Release(somSelf,ev);
  170.     
  171.     if (shouldDelete)
  172.         ODDeleteObject(somSelf);
  173.     
  174.     SOM_CATCH_ALL
  175.     SOM_ENDTRY
  176. }
  177.  
  178. //------------------------------------------------------------------------------
  179. // ODSemanticInterface::InitSemanticInterface
  180. //------------------------------------------------------------------------------
  181.  
  182. SOM_Scope void  SOMLINK ODSemanticInterfaceInitSemanticInterface(ODSemanticInterface *somSelf, Environment *ev,
  183.         ODPart* base,
  184.         ODSession* session)
  185. {
  186.     ODSemanticInterfaceData *somThis = ODSemanticInterfaceGetData(somSelf);
  187.     ODSemanticInterfaceMethodDebug("ODSemanticInterface","ODSemanticInterfaceInitSemanticInterface");
  188.  
  189.     /* Moved from somInit. SOM itself sets fields to zero
  190.     _fIsValid = kODFalse;
  191.     _fFlags = 0;
  192.     _fMessageInterface = kODNULL;
  193.     */
  194.     
  195.     SOM_TRY
  196.         somSelf->InitExtension(ev, (ODObject*)base);
  197.         _fIsValid = kODTrue;
  198.         _fMessageInterface = session->GetMessageInterface(ev);
  199.     SOM_CATCH_ALL
  200.     SOM_ENDTRY
  201. }
  202.  
  203. //------------------------------------------------------------------------------
  204. // ODSemanticInterface::CallEventHandler
  205. //------------------------------------------------------------------------------
  206.  
  207. SOM_Scope void  SOMLINK ODSemanticInterfaceCallEventHandler(ODSemanticInterface *somSelf, Environment *ev,
  208.         ODPart* thePart,
  209.         ODAppleEvent* theODAppleEvent,
  210.         ODAppleEvent* reply)
  211. {
  212.     /* ODSemanticInterfaceData *somThis = ODSemanticInterfaceGetData(somSelf); */
  213.     ODSemanticInterfaceMethodDebug("ODSemanticInterface","ODSemanticInterfaceCallEventHandler");
  214.  
  215.     ODSetSOMException(ev, errAEEventNotHandled);
  216. }
  217.  
  218. //------------------------------------------------------------------------------
  219. // ODSemanticInterface::CallCoercionHandler
  220. //------------------------------------------------------------------------------
  221.  
  222. SOM_Scope void  SOMLINK ODSemanticInterfaceCallCoercionHandler(ODSemanticInterface *somSelf, Environment *ev,
  223.         ODPart* thePart,
  224.         ODDesc* theODDesc,
  225.         ODDescType toType,
  226.         ODDesc* result)
  227. {
  228.     /* ODSemanticInterfaceData *somThis = ODSemanticInterfaceGetData(somSelf); */
  229.     ODSemanticInterfaceMethodDebug("ODSemanticInterface","ODSemanticInterfaceCallCoercionHandler");
  230.  
  231.     ODSetSOMException(ev, errAECoercionFail);
  232. }
  233.  
  234. //------------------------------------------------------------------------------
  235. // ODSemanticInterface::CallObjectAccessor
  236. //------------------------------------------------------------------------------
  237.  
  238. SOM_Scope void  SOMLINK ODSemanticInterfaceCallObjectAccessor(ODSemanticInterface *somSelf, Environment *ev,
  239.         ODPart* thePart,
  240.         ODDescType desiredClass,
  241.         ODOSLToken* container,
  242.         ODDescType containerClass,
  243.         ODDescType form,
  244.         ODDesc* selectionData,
  245.         ODOSLToken* value)
  246. {
  247.     /* ODSemanticInterfaceData *somThis = ODSemanticInterfaceGetData(somSelf); */
  248.     ODSemanticInterfaceMethodDebug("ODSemanticInterface","ODSemanticInterfaceCallObjectAccessor");
  249.  
  250.     ODSetSOMException(ev, errAEEventNotHandled);
  251. }
  252.  
  253. //------------------------------------------------------------------------------
  254. // ODSemanticInterface::CallPredispatchProc
  255. //------------------------------------------------------------------------------
  256.  
  257. SOM_Scope void  SOMLINK ODSemanticInterfaceCallPredispatchProc(ODSemanticInterface *somSelf, Environment *ev,
  258.         ODPart* thePart,
  259.         ODAppleEvent* theODAppleEvent,
  260.         ODAppleEvent* reply)
  261. {
  262.     /* ODSemanticInterfaceData *somThis = ODSemanticInterfaceGetData(somSelf); */
  263.     ODSemanticInterfaceMethodDebug("ODSemanticInterface","ODSemanticInterfaceCallPredispatchProc");
  264.  
  265.     ODSetSOMException(ev, errAEEventNotHandled);
  266. }
  267.  
  268. //------------------------------------------------------------------------------
  269. // ODSemanticInterface::CallCompareProc
  270. //------------------------------------------------------------------------------
  271.  
  272. SOM_Scope void  SOMLINK ODSemanticInterfaceCallCompareProc(ODSemanticInterface *somSelf, Environment *ev,
  273.         ODPart* thePart,
  274.         ODDescType oper,
  275.         ODOSLToken* obj1,
  276.         ODOSLToken* obj2,
  277.         ODBoolean* result)
  278. {
  279. //    ODSemanticInterfaceData *somThis = ODSemanticInterfaceGetData(somSelf);
  280.     ODSemanticInterfaceMethodDebug("ODSemanticInterface","ODSemanticInterfaceCallCompareProc");
  281.  
  282.     ODSetSOMException(ev, errAEEventNotHandled);
  283. }
  284.  
  285. //------------------------------------------------------------------------------
  286. // ODSemanticInterface::CallCallCountProc
  287. //------------------------------------------------------------------------------
  288.  
  289. SOM_Scope void  SOMLINK ODSemanticInterfaceCallCountProc(ODSemanticInterface *somSelf, Environment *ev,
  290.         ODPart* thePart,
  291.         ODDescType desiredType,
  292.         ODDescType containerClass,
  293.         ODOSLToken* container,
  294.         ODSLong* result)
  295. {
  296. //    ODSemanticInterfaceData *somThis = ODSemanticInterfaceGetData(somSelf);
  297.     ODSemanticInterfaceMethodDebug("ODSemanticInterface","ODSemanticInterfaceCallCountProc");
  298.  
  299.     ODSetSOMException(ev, errAEEventNotHandled);
  300. }
  301.  
  302. //------------------------------------------------------------------------------
  303. // ODSemanticInterface::CallDisposeTokenProc
  304. //------------------------------------------------------------------------------
  305.  
  306. SOM_Scope void  SOMLINK ODSemanticInterfaceCallDisposeTokenProc(ODSemanticInterface *somSelf, Environment *ev,
  307.         ODPart* thePart,
  308.         ODOSLToken* unneededToken)
  309. {
  310. //    ODSemanticInterfaceData *somThis = ODSemanticInterfaceGetData(somSelf);
  311.     ODSemanticInterfaceMethodDebug("ODSemanticInterface","ODSemanticInterfaceCallDisposeTokenProc");
  312.  
  313.     ODSetSOMException(ev, errAEEventNotHandled);
  314. }
  315.  
  316. //------------------------------------------------------------------------------
  317. // ODSemanticInterface::CallGetErrDescProc
  318. //------------------------------------------------------------------------------
  319.  
  320. SOM_Scope void  SOMLINK ODSemanticInterfaceCallGetErrDescProc(ODSemanticInterface *somSelf, Environment *ev,
  321.         ODPart* thePart,
  322.         ODDesc** errDesc)
  323. {
  324. //    ODSemanticInterfaceData *somThis = ODSemanticInterfaceGetData(somSelf);
  325.     ODSemanticInterfaceMethodDebug("ODSemanticInterface","ODSemanticInterfaceCallGetErrDescProc");
  326.  
  327.     ODSetSOMException(ev, errAEEventNotHandled);
  328. }
  329.  
  330. //------------------------------------------------------------------------------
  331. // ODSemanticInterface::CallGetMarkTokenProc
  332. //------------------------------------------------------------------------------
  333.  
  334. SOM_Scope void  SOMLINK ODSemanticInterfaceCallGetMarkTokenProc(ODSemanticInterface *somSelf, Environment *ev,
  335.         ODPart* thePart,
  336.         ODOSLToken* dContainerToken,
  337.         ODDescType containerClass,
  338.         ODOSLToken* result)
  339. {
  340. //    ODSemanticInterfaceData *somThis = ODSemanticInterfaceGetData(somSelf);
  341.     ODSemanticInterfaceMethodDebug("ODSemanticInterface","ODSemanticInterfaceCallGetMarkTokenProc");
  342.  
  343.     ODSetSOMException(ev, errAEEventNotHandled);
  344. }
  345.  
  346. //------------------------------------------------------------------------------
  347. // ODSemanticInterface::CallMarkProc
  348. //------------------------------------------------------------------------------
  349.  
  350. SOM_Scope void  SOMLINK ODSemanticInterfaceCallMarkProc(ODSemanticInterface *somSelf, Environment *ev,
  351.         ODPart* thePart,
  352.         ODOSLToken* dToken,
  353.         ODOSLToken* markToken,
  354.         ODSLong index)
  355. {
  356. //    ODSemanticInterfaceData *somThis = ODSemanticInterfaceGetData(somSelf);
  357.     ODSemanticInterfaceMethodDebug("ODSemanticInterface","ODSemanticInterfaceCallMarkProc");
  358.  
  359.     ODSetSOMException(ev, errAEEventNotHandled);
  360. }
  361.  
  362. //------------------------------------------------------------------------------
  363. // ODSemanticInterface::CallAdjustMarksProc
  364. //------------------------------------------------------------------------------
  365.  
  366. SOM_Scope void  SOMLINK ODSemanticInterfaceCallAdjustMarksProc(ODSemanticInterface *somSelf, Environment *ev,
  367.         ODPart* thePart,
  368.         ODSLong newStart,
  369.         ODSLong newStop,
  370.         ODOSLToken* markToken)
  371. {
  372. //    ODSemanticInterfaceData *somThis = ODSemanticInterfaceGetData(somSelf);
  373.     ODSemanticInterfaceMethodDebug("ODSemanticInterface","ODSemanticInterfaceCallAdjustMarksProc");
  374.  
  375.     ODSetSOMException(ev, errAEEventNotHandled);
  376. }
  377.  
  378. //------------------------------------------------------------------------------
  379. // ODSemanticInterface::GetOSLSupportFlags
  380. //------------------------------------------------------------------------------
  381.  
  382. SOM_Scope ODSShort  SOMLINK ODSemanticInterfaceGetOSLSupportFlags(ODSemanticInterface *somSelf, Environment *ev)
  383. {
  384.     ODSemanticInterfaceData *somThis = ODSemanticInterfaceGetData(somSelf);
  385.     ODSemanticInterfaceMethodDebug("ODSemanticInterface","ODSemanticInterfaceGetOSLSupportFlags");
  386.  
  387.     return _fFlags;
  388. }
  389.  
  390. //------------------------------------------------------------------------------
  391. // ODSemanticInterface::SetOSLSupportFlags
  392. //------------------------------------------------------------------------------
  393.  
  394. SOM_Scope void  SOMLINK ODSemanticInterfaceSetOSLSupportFlags(ODSemanticInterface *somSelf, Environment *ev,
  395.         ODSShort flags)
  396. {
  397.     ODSemanticInterfaceData *somThis = ODSemanticInterfaceGetData(somSelf);
  398.     ODSemanticInterfaceMethodDebug("ODSemanticInterface","ODSemanticInterfaceSetOSLSupportFlags");
  399.  
  400.     // OpenDoc does not support marking
  401.     if (flags & kAEIDoMarking != 0) {
  402.         WARN("OpenDoc does not support marking.  I'm turning it off.");
  403.         flags &= ~kAEIDoMarking;
  404.     }
  405.     _fFlags = flags;
  406. }
  407.  
  408. //------------------------------------------------------------------------------
  409. // ODSemanticInterface::UsingPredispatchProc
  410. //------------------------------------------------------------------------------
  411.  
  412. SOM_Scope void  SOMLINK ODSemanticInterfaceUsingPredispatchProc(ODSemanticInterface *somSelf, Environment *ev,
  413.         ODBoolean usingNotUsing)
  414. {
  415.     ODSemanticInterfaceData *somThis = ODSemanticInterfaceGetData(somSelf);
  416.     ODSemanticInterfaceMethodDebug("ODSemanticInterface","ODSemanticInterfaceUsingPredispatchProc");
  417.  
  418.     SOM_TRY
  419.     
  420.     if (usingNotUsing != kODFalse)
  421.         _fMessageInterface->PreHandlerAdded(ev, somSelf, 0);
  422.     else
  423.         _fMessageInterface->PreHandlerRemoved(ev, somSelf, 0);
  424.     
  425.     SOM_CATCH_ALL
  426.     SOM_ENDTRY
  427. }
  428.  
  429.